# 常用插件
- .ignore (opens new window)
- GenerateAllSetter (opens new window)
- GenerateSerialVersionUID (opens new window)
- Grep Console (opens new window)
- Rainbow Brackets (opens new window)
- String Manipulation (opens new window)
- VisualVM Launcher (opens new window)
- Alibaba Java Coding Guidelines (opens new window)
- Key Promoter X (opens new window)
- Lombok (opens new window)
- 注意在 settings->Build, Exection, Deployment->Compiler->Annotation Processors 开启 Enable annotation processing. idea 高版本已经内置。
- Maven Helper (opens new window)
- GsonFormat (opens new window)
- MyBatisX (opens new window)
- Database Navigator (opens new window) 数据库连接工具
- Spring Boot Assistant (opens new window)
- Spring Initializr and Assistant (opens new window)
- RestfulTool (opens new window) 接口测试,类似于 postman 一样
- Codota AI Autocomplete for Java and JavaScript (opens new window) 代码智能提示,只需输入首字母
- CodeGlance3 (opens new window) 显示代码缩略图
- Statistic (opens new window) 代码统计
- Vuesion Theme (opens new window) idea 皮肤
- 启用 Vuesion Theme 后,再禁用,代码背景颜色变成白色的问题
- setting -> Editor -> Color Schema -> 选择Schema 为 Darcula -> 保存。
- 启用 Vuesion Theme 后,再禁用,代码背景颜色变成白色的问题
- File Expander (opens new window) explore archive-based file in project view
- GitToolBox (opens new window) Git status
- arthas idea (opens new window) Alibaba Arthas command. 进入代码片段,选择你要诊断的类或者方法上面,右击打开Arthas命令,选择一项,即可自动生成命令,省去你敲打命令的时间。
- Alibaba Cloud AI Coding Assistant (opens new window)
- Alibaba Cloud Toolkit (opens new window)
- Developer Tools (opens new window)
# 常用配置
# 设置软件启动时选择项目进入,取消关闭确认弹窗
Settings -> Appearacne & Behavior -> System Settings:
去掉复选框对勾:Confirm before exiting the IDE
去掉复选框对勾:Reopen projects on startup
# 菜单栏字体和大小
Settings -> Appearacne & Behavior -> Appearance:
- 勾选复选框:Use custom font: Microsoft YaHei UI; Size: 14
# 编辑代码的字体和大小
Settings -> Editor -> Font:
- Font: Consolas
- Size: 16
- Line height: 1.2
# 取消字符串严格按照大小写匹配
Settings -> Editor -> General -> Code Completion:
- 去掉复选框对勾:Match case:
# 双斜杠注释改为紧跟代码头
Settings -> Editor -> Code Style -> Java -> Code Generation(tab 页签,看不到的话,点击页签最右侧的下三角图标):
- 去掉复选框对勾:Line comment at first column
- 打上复选框对勾:Add a space at comment start
# CTRL + 鼠标滚轮,改变字体大小(缩放)
Settings -> Editor -> General:
- 打上复选框对勾:Change font size (Zoom) with Ctrl+Mouse Wheel
# 优化版本控制(git、svn)的目录颜色展示(idea 低版本)
代码改变时,目录颜色跟着改变
Settings -> Version Control:
- 打上复选框对勾:Show directories with changed descendants
# 设置 Project 中间 package 的不折叠(去掉对勾)
# 设置 tab 页单行显示
Settings -> Editor -> Editor Tabs:
- 以下两个打对勾:Show tabs in:
- One row, and if tabs don't fit:
- Scroll the tabs panel
- 打对勾:Hide tabs if there is no space
# 创建文件时,自动生成作者和时间信息
# 显示行号和方法分割线
Settings -> Editor -> Appearance:
- Show line numbers
- Show method separators
# 显示内存使用情况
View -> Appearance -> Status Bar Widgets -> Memory Indicator(打对勾)
# 快速添加明确的导入包和快速优化导入包(自动帮助删除无用的导入)
Settings -> Editor -> General -> Auto Import:
- 打对勾:Add unambiguous imports on the fly
- 打对勾:Optimize imports on the fly
# 取消多个导入包import自动合并成 *(设置为999个才合并成 *)
Settings -> Editor -> Code Style -> Java -> Imports(tab页签):
- Class count to use import with '*': 999
- Names count to use static import with '*': 999
# UTF-8 编码,及 properties 文件 Transparent native-to-ascii conversion
Settings -> Editor -> File Encodings:
- Global Encoding: UTF-8
- Project Encoding: UTF-8
- Default encoding for properties files: UTF-8; 打对勾:Transparent native-to-ascii conversion
- Create UTF-8 files: with NO BOM
# Maven deploy 中文乱码
Settings -> Build, Execution, Deployment -> Build Tools -> Maven -> Runner:
- VM Options: -Dfile.encoding=GBK
# 打开vue工程时,卡在加载Index(是由于vue工程node_modules下文件太多了)
# 设置 JVM 内存大小
Help -> Edit Custom VM Options... -> (idea64.exe.vmoptions 文本编辑) 添加下面一行参数:
-Xmx2048m
# 设置 在单元测试中,可以使用 Scanner 使开发者与控制台交互
Help -> Edit Custom VM Options... -> (idea64.exe.vmoptions 文本编辑) 添加下面一行参数:
-Deditable.java.test.console=true
# 编写的 *.sh 脚本上传到 Linux 服务器执行报错(由于换行符差异导致)
一般为在 Windows 下用 IDEA 导入项目编译时,默认使用Windows(\r\n)下的文件换行符,而 Unix 类操作系统换行符为 \n,所以 idea 做以下设置:
idea 高版本:Settings -> Editor -> Code Style -> Shell Script: 勾选 Use Unix line separators(\n)
idea 低版本:Settings -> Editor -> Code Style -> Line separator:选择 Unix and MacOs(\n)